package com.guet.niit.Agent.service;

import com.guet.niit.Agent.dao.AgentDao;
import com.guet.niit.Agent.dao.AgentDaoImpl;
import com.guet.niit.Agent.pojo.Agent;

import java.util.List;

//任务：调用AgentDao接口里的方法
public class AgentService {

    //获取展示invest表内的结果集（投资详细信息）
    public void Invest_Found(){
        AgentDao a=new AgentDaoImpl();
            List<Agent> investFound= a.InvestFound();
        for (int i = 0; i < investFound.size(); i++) {
            System.out.println(investFound.get(i));
        }
//            System.out.println(jg);
    }
    public void InvestCost(){
        long id=789654123698521472l;
        AgentDao agentDao=new AgentDaoImpl();
        agentDao.InvestSelect(id);
    }
//    利润的详细信息789654123698521472789654123698521472
//    public void Profit_Found(){
    public List<Agent> Profit_Found(Long agentId){
        AgentDao agentDao=new AgentDaoImpl();
//        List<Agent> profitFound=agentDao.ProfitFound();
        List<Agent> profitFound=agentDao.ProfitFound(agentId);
//        for (int i = 0; i < profitFound.size(); i++) {
//            System.out.println(profitFound.get(i));
//        }
        return profitFound;
    }
//    利润获取
    public void Profit_Gain(){
       long id=852146231525123264l;
        AgentDao agentDao=new AgentDaoImpl();
        agentDao.ProfitGain(id);
//        System.out.println(profitGain);
    }
//    当前总利润
//    调用接口内方法
//a.InvestFound();
}
